package com.qingfeng.client.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qingfeng.client.bean.GoodsCommon;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zhangyuefei
 * @version 1.0
 * @date 2020/1/6 10:16 上午
 */
public interface GoodsCommonMapper extends BaseMapper<GoodsCommon> {


    List<GoodsCommon> selectByNameAndStoreId(@Param("name")String name,@Param("storeId")Integer storeId);




    List<GoodsCommon> getStoreIndexGoods(@Param("storeId")Long storeId);

    List<GoodsCommon> getStoreGoods(@Param("storeId")Long storeId,@Param("type")Long type);


    GoodsCommon getBySort(int newSort);

    //是否需要在实体类中添加字段
    void updateOld(@Param("oldSort")int oldSort,@Param("oldId")long oldId);

    void updates(@Param("id")int id,@Param("sort") int newSort);

    void updateNew(@Param("sort")int newSort,@Param("activity") int oldActivity,@Param("id") int id);

    void updateOldNull(@Param("oldSort")int oldSort,@Param("oldId") Long oldId);

    int getTypeid(@Param("id") Long id);

}
